package com.ruoyi.manage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.DeptWorkScheduleMapper;
import com.ruoyi.manage.domain.DeptWorkSchedule;
import com.ruoyi.manage.service.IDeptWorkScheduleService;

/**
 * 部门排班Service业务层处理
 * 
 * @author cf
 * @date 2025-05-29
 */
@Service
public class DeptWorkScheduleServiceImpl implements IDeptWorkScheduleService 
{
    @Autowired
    private DeptWorkScheduleMapper deptWorkScheduleMapper;

    /**
     * 查询部门排班
     * 
     * @param workScheduleId 部门排班主键
     * @return 部门排班
     */
    @Override
    public DeptWorkSchedule selectDeptWorkScheduleByWorkScheduleId(Long workScheduleId)
    {
        return deptWorkScheduleMapper.selectDeptWorkScheduleByWorkScheduleId(workScheduleId);
    }

    /**
     * 查询部门排班列表
     * 
     * @param deptWorkSchedule 部门排班
     * @return 部门排班
     */
    @Override
    public List<DeptWorkSchedule> selectDeptWorkScheduleList(DeptWorkSchedule deptWorkSchedule)
    {
        return deptWorkScheduleMapper.selectDeptWorkScheduleList(deptWorkSchedule);
    }

    /**
     * 新增部门排班
     * 
     * @param deptWorkSchedule 部门排班
     * @return 结果
     */
    @Override
    public int insertDeptWorkSchedule(DeptWorkSchedule deptWorkSchedule)
    {
        deptWorkSchedule.setCreateTime(DateUtils.getNowDate());
        return deptWorkScheduleMapper.insertDeptWorkSchedule(deptWorkSchedule);
    }

    /**
     * 修改部门排班
     * 
     * @param deptWorkSchedule 部门排班
     * @return 结果
     */
    @Override
    public int updateDeptWorkSchedule(DeptWorkSchedule deptWorkSchedule)
    {
        deptWorkSchedule.setUpdateTime(DateUtils.getNowDate());
        return deptWorkScheduleMapper.updateDeptWorkSchedule(deptWorkSchedule);
    }

    /**
     * 批量删除部门排班
     * 
     * @param workScheduleIds 需要删除的部门排班主键
     * @return 结果
     */
    @Override
    public int deleteDeptWorkScheduleByWorkScheduleIds(Long[] workScheduleIds)
    {
        return deptWorkScheduleMapper.deleteDeptWorkScheduleByWorkScheduleIds(workScheduleIds);
    }

    /**
     * 删除部门排班信息
     * 
     * @param workScheduleId 部门排班主键
     * @return 结果
     */
    @Override
    public int deleteDeptWorkScheduleByWorkScheduleId(Long workScheduleId)
    {
        return deptWorkScheduleMapper.deleteDeptWorkScheduleByWorkScheduleId(workScheduleId);
    }
}
